<?php

class Db_Tables_Level3 extends Zend_Db_Table
{
    protected $_name = 'level3';
	var $lcb_market_id;
	
	function WechatShare()
	{
		$result = array(
			'title' => NULL,
			'desc' => NULL,
			'image_url' => NULL,
			'link' => NULL
		);
		
		if($this->lcb_market_id)
		{
			$mod_params = new Db_Tables_SysParams();
			$base_url = $mod_params->GetVal("base_url");
			
			$row = $this->fetchRow("lcb_market_id='".$this->lcb_market_id."'");
			
			if($row)
			{
				$result['title'] = $row->banner_text;
				$result['desc'] = $row->slogan;
				$result['image_url'] = $base_url."images/banners/".$row->banner_url;
				$result['link'] = $base_url."index/level2/level_id/".$row->level2_id;
			}
		}
		
		return $result;
	}
}